package com.le.tester.book.effectivejava3rdchinese.articlethirtyeight;

/**
 * createTime：2022/8/22 16:08
 * description：enum继承接口，提供灵活性
 */
public enum BasicOperation implements Operation {

    PLUS("+") {
        public double apply(double x, double y) {
            return x + y;
        }
    };


    private final String symbol;

    BasicOperation(String symbol) {
        this.symbol = symbol;
    }

    @Override
    public String toString() {
        return symbol;
    }
}
